package com.ruoyi.farmwell.ghy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.farmwell.ghy.domain.SysGhy;
import com.ruoyi.farmwell.ghy.mapper.SysGhyMapper;
import com.ruoyi.farmwell.ghy.service.ISysGhyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 管护人员Service业务层处理
 * 
 * @author Zjp
 * @date 2024-08-03
 */
@Service
public class SysGhyServiceImpl implements ISysGhyService
{
    @Autowired
    private SysGhyMapper sysGhyMapper;

    /**
     * 查询管护人员
     * 
     * @param id 管护人员主键
     * @return 管护人员
     */
    @Override
    public SysGhy selectSysGhyById(Long id)
    {
        return sysGhyMapper.selectSysGhyById(id);
    }

    /**
     * 查询管护人员列表
     * 
     * @param sysGhy 管护人员
     * @return 管护人员
     */
    @Override
    public List<SysGhy> selectSysGhyList(SysGhy sysGhy)
    {
        return sysGhyMapper.selectSysGhyList(sysGhy);
    }

    @Override
    public List<SysGhy> selectSysGhy(SysGhy sysGhy) {
        return sysGhyMapper.selectSysGhy(sysGhy);
    }

    /**
     * 新增管护人员
     * 
     * @param sysGhy 管护人员
     * @return 结果
     */
    @Override
    public int insertSysGhy(SysGhy sysGhy)
    {
        sysGhy.setCreateTime(DateUtils.getNowDate());
        return sysGhyMapper.insertSysGhy(sysGhy);
    }

    /**
     * 修改管护人员
     * 
     * @param sysGhy 管护人员
     * @return 结果
     */
    @Override
    public int updateSysGhy(SysGhy sysGhy)
    {
        sysGhy.setUpdateTime(DateUtils.getNowDate());
        return sysGhyMapper.updateSysGhy(sysGhy);
    }

    /**
     * 批量删除管护人员
     * 
     * @param ids 需要删除的管护人员主键
     * @return 结果
     */
    @Override
    public int deleteSysGhyByIds(Long[] ids)
    {
        return sysGhyMapper.deleteSysGhyByIds(ids);
    }

    /**
     * 删除管护人员信息
     * 
     * @param id 管护人员主键
     * @return 结果
     */
    @Override
    public int deleteSysGhyById(Long id)
    {
        return sysGhyMapper.deleteSysGhyById(id);
    }
}
